package com.project.server.service.estates.impl;

import com.project.common.core.domain.BaseServer;
import com.project.server.domain.estates.TPayRule;
import com.project.server.mapper.estates.TPayRuleMapper;
import com.project.server.service.estates.ITPayRuleService;
import org.mybatis.logging.Logger;
import org.mybatis.logging.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 缴费规则Service业务层处理
 *
 * @author project
 * @date 2021-06-28
 */
@Service
public class TPayRuleServiceImpl extends BaseServer implements ITPayRuleService {

    private static final Logger log = LoggerFactory.getLogger(TPayRuleServiceImpl.class);

    @Resource
    private TPayRuleMapper tPayRuleMapper;

    /**
     * 查询缴费规则
     *
     * @param ruleId 缴费规则ID
     * @return 缴费规则
     */
    @Override
    public TPayRule selectTPayRuleById(Long ruleId) {
        return tPayRuleMapper.selectTPayRuleById(ruleId);
    }

    /**
     * 查询缴费规则列表
     *
     * @param tPayRule 缴费规则
     * @return 缴费规则
     */
    @Override
    public List<TPayRule> selectTPayRuleList(TPayRule tPayRule) {
        return tPayRuleMapper.selectTPayRuleList(tPayRule);
    }

    /**
     * 根据企业id查询缴费规则列表
     *
     * @param  compId 企业id
     * @return 缴费规则
     */
    @Override
    public List<Integer> selectTCompanyByCompId(Long compId) {
        return tPayRuleMapper.selectTCompanyByCompId(compId);
    }

    /**
     * 查询所有缴费规则列表
     *
     * @return 缴费规则列表
     */
    @Override
    public List<TPayRule> selectTPayRuleAll(){
        return tPayRuleMapper.selectTPayRuleAll();
    }
    /**
     * 新增缴费规则
     *
     * @param tPayRule 缴费规则
     * @return 结果
     */
            @Override
    public int insertTPayRule(TPayRule tPayRule) {
        super.insert(tPayRule);
                    return tPayRuleMapper.insertTPayRule(tPayRule);
            }

    /**
     * 修改缴费规则
     *
     * @param tPayRule 缴费规则
     * @return 结果
     */
            @Override
    public int updateTPayRule(TPayRule tPayRule) {
        super.update(tPayRule);
                return tPayRuleMapper.updateTPayRule(tPayRule);
    }

    /**
     * 批量删除缴费规则
     *
     * @param ruleIds 需要删除的缴费规则ID
     * @return 结果
     */
            @Override
    public int deleteTPayRuleByIds(Long[] ruleIds) {
                return tPayRuleMapper.deleteTPayRuleByIds(ruleIds);
    }

    /**
     * 删除缴费规则信息
     *
     * @param ruleId 缴费规则ID
     * @return 结果
     */
    @Override
    public int deleteTPayRuleById(Long ruleId) {
                return tPayRuleMapper.deleteTPayRuleById(ruleId);
    }
    }
